home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
strucpgm.arc
/
BLACKJAC.BAS
next >
Wrap
BASIC Source File
|
1987-01-30
|
8KB
|
358 lines
2 OPTION BASE 1
3 DIM AZ( 1 ),A%( 21 ),A$( 6 ),B$( 1 )
4 DIM AA%(52,2)
503 COMMON AZ(),A%(),A$(),B$()
504 COMMON AA%()
1001 GOTO 1014
1002 ::
1003 A%(17)=1
1004 FOR AA%=1 TO 4 STEP 1
1005 A%(15)=AA%
1006 FOR AB%=1 TO 13 STEP 1
1007 A%(16)=AB%
1008 AA%(A%(17),1)=A%(16)
1009 AA%(A%(17),2)=A%(15)
1010 A%(17)=A%(17)+1
1011 NEXT
1012 NEXT
1013 RETURN
1014 :
1015 GOTO 1030
1016 ::
1017 FOR AC%=52 TO 1 STEP -1
1018 A%(20)=AC%
1019 RANDOMIZE VAL(RIGHT$(TIME$,2))
1020 A%(18)=AA%(A%(20),1)
1021 A%(19)=AA%(A%(20),2)
1022 A%(21)=INT(RND*52)+1
1023 AA%(A%(20),1)=AA%(A%(21),1)
1024 AA%(A%(20),2)=AA%(A%(21),2)
1025 AA%(A%(21),1)=A%(18)
1026 AA%(A%(21),2)=A%(19)
1027 A%(3)=1
1028 NEXT
1029 RETURN
1030 :
1031 GOTO 1046
1032 ::
1033 LOCATE A%(9),A%(8)
1034 PRINT " _______"
1035 LOCATE A%(9)+1,A%(8)
1036 PRINT "| |"
1037 LOCATE A%(9)+2,A%(8)
1038 PRINT "| |"
1039 LOCATE A%(9)+3,A%(8)
1040 PRINT "| |"
1041 LOCATE A%(9)+4,A%(8)
1042 PRINT "| |"
1043 LOCATE A%(9)+5,A%(8)
1044 PRINT "|_______|"
1045 RETURN
1046 :
1047 GOTO 1060
1048 ::
1049 LOCATE 2,1
1050 PRINT " mmmmmmmm"
1051 PRINT " /~~~~~~~~~~~~\"
1052 PRINT " / \"
1053 PRINT " | |"
1054 PRINT " (| |"
1055 PRINT " | _\ |"
1056 PRINT " | |"
1057 PRINT " \ === /"
1058 PRINT " \_________/"
1059 RETURN
1060 :
1061 GOTO 1068
1062 ::
1063 LOCATE 4,7
1064 PRINT " "
1065 LOCATE 5,7
1066 PRINT " ~o~ ~o~ "
1067 RETURN
1068 :
1069 GOTO 1086
1070 ::
1071 LOCATE 8,12
1072 PRINT " ___"
1073 LOCATE 9,12
1074 PRINT "(___)"
1075 FOR AD%=1 TO 50 STEP 1
1076 A%(2)=AD%
1077 NEXT
1078 LOCATE 8,12
1079 PRINT " "
1080 LOCATE 9,12
1081 PRINT " === "
1082 FOR AE%=1 TO 50 STEP 1
1083 A%(2)=AE%
1084 NEXT
1085 RETURN
1086 :
1087 GOTO 1106
1088 ::
1089 LOCATE 4,7
1090 PRINT "~~~ \ / ~~~"
1091 LOCATE 5,7
1092 PRINT " o o"
1093 GOSUB 1070
1094 LOCATE 23,1
1095 PRINT " PLAYER"
1096 GOSUB 1070
1097 LOCATE 23,10
1098 PRINT "WINS "
1099 FOR AF%=1 TO 1000 STEP 1
1100 A%(1)=AF%
1101 NEXT
1102 LOCATE 23,1
1103 PRINT " "
1104 GOSUB 1062
1105 RETURN
1106 :
1107 GOTO 1125
1108 ::
1109 GOSUB 1070
1110 LOCATE 23,1
1111 PRINT "DEALER"
1112 GOSUB 1070
1113 LOCATE 23,8
1114 PRINT "WINS"
1115 LOCATE 9,12
1116 PRINT "\___/"
1117 FOR AG%=1 TO 1000 STEP 1
1118 A%(10)=AG%
1119 NEXT
1120 LOCATE 9,12
1121 PRINT " === "
1122 LOCATE 23,1
1123 PRINT " "
1124 RETURN
1125 :
1126 GOTO 1189
1127 ::
1128 IF A%(6)>1 THEN 1130
1129 GOTO 1164
1130 IF A%(6)<10 THEN 1132
1131 GOTO 1134
1132 A$(3)=CHR$(A%(6)+48)
1133 GOTO 1135
1134 :
1135 :
1136 IF A%(6)=10 THEN 1138
1137 GOTO 1140
1138 A$(3)="10"
1139 GOTO 1141
1140 :
1141 :
1142 IF A%(6)=11 THEN 1144
1143 GOTO 1147
1144 A$(3)="J"
1145 A%(6)=10
1146 GOTO 1148
1147 :
1148 :
1149 IF A%(6)=12 THEN 1151
1150 GOTO 1154
1151 A$(3)="Q"
1152 A%(6)=10
1153 GOTO 1155
1154 :
1155 :
1156 IF A%(6)=13 THEN 1158
1157 GOTO 1161
1158 A$(3)="K"
1159 A%(6)=10
1160 GOTO 1162
1161 :
1162 :
1163 GOTO 1174
1164 :
1165 A$(3)="A"
1166 IF A%(14)+11>21 THEN 1168
1167 GOTO 1170
1168 A%(6)=1
1169 GOTO 1173
1170 :
1171 A%(6)=11
1172 A$(6)="Y"
1173 :
1174 :
1175 A%(14)=A%(14)+A%(6)
1176 IF A%(14)>21 THEN 1178
1177 GOTO 1186
1178 IF A$(6)="Y" THEN 1180
1179 GOTO 1183
1180 A%(14)=A%(14)-10
1181 A$(6)="N"
1182 GOTO 1184
1183 :
1184 :
1185 GOTO 1187
1186 :
1187 :
1188 RETURN
1189 :
1190 GOTO 1199
1191 ::
1192 A%(4)=A%(4)+1
1193 A%(9)=14
1194 A%(8)=A%(4)*13-3
1195 GOSUB 1032
1196 LOCATE 17,A%(4)*13
1197 PRINT A$(3)
1198 RETURN
1199 :
1200 GOTO 1209
1201 ::
1202 A%(5)=A%(5)+1
1203 A%(9)=5
1204 A%(8)=A%(5)*13+8
1205 GOSUB 1032
1206 LOCATE 8,A%(5)*13+11
1207 PRINT A$(3)
1208 RETURN
1209 :
1210 GOTO 1238
1211 ::
1212 A%(6)=AA%(A%(3),1)
1213 IF A$(1)="D" THEN 1215
1214 GOTO 1222
1215 A%(14)=A%(13)
1216 A$(6)=A$(5)
1217 GOSUB 1127
1218 A%(13)=A%(14)
1219 A$(5)=A$(6)
1220 GOSUB 1201
1221 GOTO 1229
1222 :
1223 A%(14)=A%(12)
1224 A$(6)=A$(4)
1225 GOSUB 1127
1226 A%(12)=A%(14)
1227 A$(4)=A$(6)
1228 GOSUB 1191
1229 :
1230 A%(3)=A%(3)+1
1231 IF A%(3)>52 THEN 1233
1232 GOTO 1235
1233 GOSUB 1016
1234 GOTO 1236
1235 :
1236 :
1237 RETURN
1238 :
1239 A%(7)=1000
1240 GOSUB 1002
1241 GOSUB 1016
1242 IF A%(7)>0 THEN 1243 ELSE GOTO 1352
1243 FOR AI%=1 TO 50 STEP 1
1244 A%(1)=AI%
1245 PRINT " "
1246 NEXT
1247 GOSUB 1048
1248 GOSUB 1062
1249 LOCATE 2,50
1250 PRINT " CREDIT ......$ "
1251 LOCATE 2,66
1252 PRINT A%(7)
1253 GOSUB 1070
1254 LOCATE 23,1
1255 PRINT "PLACE "
1256 GOSUB 1070
1257 LOCATE 23,7
1258 PRINT "YOUR "
1259 GOSUB 1070
1260 LOCATE 23,12
1261 PRINT "BET "
1262 LOCATE 23,17
1263 INPUT A%(11)
1264 LOCATE 23,1
1265 PRINT " "
1266 A%(4)=0
1267 A%(5)=0
1268 A%(12)=0
1269 A%(13)=0
1270 A$(4)="N"
1271 A$(5)="N"
1272 A$(1)="P"
1273 GOSUB 1211
1274 A$(1)="D"
1275 GOSUB 1211
1276 A$(1)="P"
1277 GOSUB 1211
1278 A$(1)="D"
1279 GOSUB 1211
1280 A$(1)="P"
1281 GOSUB 1070
1282 LOCATE 23,1
1283 PRINT "STAY "
1284 GOSUB 1070
1285 LOCATE 23,6
1286 PRINT "OR "
1287 GOSUB 1070
1288 LOCATE 23,9
1289 PRINT "HIT "
1290 LOCATE 23,14
1291 INPUT A$(2)
1292 LOCATE 23,1
1293 PRINT " "
1294 IF A$(2)="H" THEN 1295 ELSE GOTO 1316
1295 GOSUB 1211
1296 IF A%(12)<21 THEN 1298
1297 GOTO 1312
1298 GOSUB 1070
1299 LOCATE 23,1
1300 PRINT "STAY "
1301 GOSUB 1070
1302 LOCATE 23,6
1303 PRINT "OR "
1304 GOSUB 1070
1305 LOCATE 23,9
1306 PRINT "HIT "
1307 LOCATE 23,14
1308 INPUT A$(2)
1309 LOCATE 23,1
1310 PRINT " "
1311 GOTO 1314
1312 :
1313 A$(2)="S"
1314 :
1315 GOTO 1294
1316 :
1317 A$(1)="D"
1318 IF A%(12)<22 THEN 1320
1319 GOTO 1326
1320 IF A%(13)<16 THEN 1321 ELSE GOTO 1324
1321 GOSUB 1211
1322 GOSUB 1127
1323 GOTO 1320
1324 :
1325 GOTO 1327
1326 :
1327 :
1328 IF A%(12)>21 THEN 1330
1329 GOTO 1333
1330 GOSUB 1108
1331 A%(7)=A%(7)-A%(11)
1332 GOTO 1350
1333 :
1334 IF A%(13)>21 THEN 1336
1335 GOTO 1339
1336 GOSUB 1088
1337 A%(7)=A%(7)+A%(11)
1338 GOTO 1349
1339 :
1340 IF A%(12)<=A%(13) THEN 1342
1341 GOTO 1345
1342 GOSUB 1108
1343 A%(7)=A%(7)-A%(11)
1344 GOTO 1348
1345 :
1346 GOSUB 1088
1347 A%(7)=A%(7)+A%(11)
1348 :
1349 :
1350 :
1351 GOTO 1242
1352 :